<template>
	<view>
		<bg-video></bg-video>
		<cu-custom bgColor="bg-purple" :isBack="true">
			<block class="text-white " slot="content">门店绑定申请</block>
		</cu-custom>
		
		
		<view class="cu-form-group">
			<view class="title">选择门店：</view>
			<view class="flex justify-end align-center">
				<zqs-select 
					value-key="storeid" label-key="mdname" title="选择门店" 
					:list="stores" v-model="amdjlsqitem.storeid"></zqs-select>
			</view>
		</view>
		
		<view class="cu-form-group">
			<view class="title">教练姓名：</view>
			<text>{{amdjl.mdjlname}}</text>
		</view>
		<view class="cu-form-group">
			<view class="title">联系电话：</view>
			<text>{{amdjl.tel}}</text>
		</view>
		
		<view class="padding">
			<button @tap="submitsq" class="cu-btn block bg-purple lg">提交申请</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				amdjl: this.store.state.mdjl,
				amdjlsqitem: {
					mdjlsqid: "",
					mdjlid: this.store.state.mdjl.mdjlid,
					mdjlname: this.store.state.mdjl.mdjlname,
					storeid: "",
					mdname: "",
				},
				stores: [],
			};
		}, 
		methods: {
			submitsq: function() { 
				if (!this.amdjlsqitem.storeid) {
					this.message.error("请选择门店");
					return;
				}
				
				this.api("/mdjl/sq").send({
					amdjlsqitem: this.amdjlsqitem
				}).then(res => {
					this.message.info("申请成功");
					uni.navigateBack();
				});
			},
			loadMds: function() {
				this.constant.loadMds().then(data => {
					this.stores = data.astores;
				});
			}
		},
		
		onLoad: function() {
			this.loadMds();
		}
	}
</script>
<style>
</style>